package com.wudimeng.syll.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 名称: 工具类 描述: 正则匹配工具类
 */
public class Regular {



    /**
     * 正整数正则
     * @param str   过滤字符串
     * @return
     */
    public static boolean checkInt(String str){
            //定义匹配html标签
            String regex = "^\\d+$";
            return startCheck(regex,str);
    }

    public static boolean startCheck(String reg,String string){
        boolean tem=false;

        Pattern pattern = Pattern.compile(reg);
        Matcher matcher=pattern.matcher(string);

        tem=matcher.matches();
        return tem;
    }

    public static void main(String[] a) {
        System.out.print(checkInt("123xdsd"));
        System.out.print(123);
    }
}
